ElementAt(TSource) Method

Task Parallel System.Threading

Returns the element at a specified index in a parallel sequence.

Namespace:  System.Linq
Assembly:  System.Threading (in System.Threading.dll)

Syntax

Visual Basic (Declaration)
Public Shared Function ElementAt(Of TSource) ( _
	source As ParallelQuery(Of TSource), _
	index As Integer _
) As TSource
C#
public static TSource ElementAt<TSource>(
	ParallelQuery<TSource> source,
	int index
)

Parameters

source
Type: System.Linq..::.ParallelQuery<(Of <(TSource>)>)
A sequence to return an element from.
index
Type: System..::.Int32
The zero-based index of the element to retrieve.

Type Parameters

TSource
The type of the elements of source.

Return Value

The element at the specified position in the source sequence.

Exceptions

ExceptionCondition
System..::.ArgumentNullException source is a null reference (Nothing in Visual Basic).
System..::.ArgumentOutOfRangeException index is less than 0 or greater than or equal to the number of elements in source.
System..::.AggregateException One or more exceptions occurred during the evaluation of the query.
System..::.OperationCanceledException The query was canceled.

See Also